//
//  BPshareSdkView.m
//  BeautyPicture
//
//  Created by 沈振邦 on 15/9/17.
//  Copyright (c) 2015年 szb. All rights reserved.
//

#import "BPshareSdkView.h"
//#import "BPhomeMenuBtn.h"

#define bgcolor BPColor(238, 238, 238)

@interface UIView()

@end

@implementation BPshareSdkView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = bgcolor;
        self.userInteractionEnabled = YES;
        [self setUplabel];
        
        [self setUpShareBtn];
    }
    return self;
}

- (void)setUplabel
{
    _promptLabel = [[UILabel alloc] initWithFrame:CGRectMake(30.0f, BPStatusCellInset, BPScreenW - 60.0f, 60)];
    NSString *str = @"直接使用大家归秀分享，颜值担当，智商更碾压!";
    _promptLabel.textAlignment = NSTextAlignmentCenter;
    _promptLabel.numberOfLines = 0;
    _promptLabel.text = str;
    [self addSubview:_promptLabel];
    
}

- (void)setUpShareBtn
{
//    CGFloat btnW = 80.0f;
//    CGFloat btnY = CGRectGetMaxY(_promptLabel.frame);
//    CGFloat btnD = (BPScreenW - btnW * 3) / 4.0f;
//    NSArray *btnName = [NSArray arrayWithObjects:@"微信",@"朋友圈",@"QQ",@"新浪微博",@"大家归秀",@"QQ空间", nil];
//    NSArray *btnImage = [NSArray arrayWithObjects:@"wx",@"friend",@"QQ",@"Weibo",@"Guixiu",@"QQKJ",nil];
//    for (int i = 0; i < 6; i ++) {
//        BPhomeMenuBtn *shareBtn = [[BPhomeMenuBtn alloc] initWithFrame:CGRectMake(0, 0, btnW, 80.0f)];
//        shareBtn.btnimage.image = [UIImage imageNamed:btnImage[i]];
//        
//        [shareBtn.btnimage.layer setCornerRadius:0];
//        shareBtn.btnimage.layer.shadowOffset =  CGSizeMake(0, 0);
//        shareBtn.btnimage.layer.shadowOpacity = 0;
//        shareBtn.btnimage.layer.shadowColor = [UIColor clearColor].CGColor;
//        
//        shareBtn.btnlab.text = btnName[i];
//        shareBtn.delegate = self;
//        shareBtn.tag = i + 10;
//        [self addSubview:shareBtn];
//        if (i < 3) {
//           shareBtn.frame = CGRectMake(btnD + (btnW + btnD) * i, btnY, btnW, 90.0f);
//        }else{
//            shareBtn.frame = CGRectMake(btnD + (btnW + btnD) * (i - 3), btnY + 100, btnW, 90.0f);
//        }
//        
//    }
}

//- (void)homeBtnTouchUpInside:(BPhomeMenuBtn *)homeBtn
//{
//    switch (homeBtn.tag) {
//        case 10:
//            homeBtn.tag = BPShareToWX;
//            break;
//        case 11:
//            homeBtn.tag = BPShareToWXFriend;
//            break;
//        case 12:
//            homeBtn.tag = BPShareToQQ;
//            break;
//        case 13:
//            homeBtn.tag = BPShareToWeibo;
//            break;
//        case 14:
//            homeBtn.tag = BPShareToBP;
//            break;
//        case 15:
//            homeBtn.tag = BPshareToQQKJ;
//            break;
//        default:
//            break;
//    }
//    
//    if ([self.delegate respondsToSelector:@selector(shareToolView: didClickButton:)]) {
//        [self.delegate shareToolView:self didClickButton:homeBtn.tag];
//    }
//}

//- (void)layoutSubviews
//{
//    [super layoutSubviews];
//    NSInteger count = self.subviews.count;
//    CGFloat buttonW = self.width / count;
//    CGFloat buttonH = self.height;
//    for (int i = 0; i < count; i ++) {
//        UIButton *button = self.subviews[i];
//        button.y = 0;
//        button.width = buttonW;
//        button.height = buttonH;
//        button.x = i * buttonW;
//    }
//}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
